/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package demo04;

/**
 *
 * @author 卢仕威
 */
public class CheckID {
    public static void main(String[] args) {
        String ID="45022219920126131x";
        boolean flag=true;
        if(ID.length()!=18){
            flag=false;
    }
        String mumstr="0123456789x";
      for(int i=0;i<ID.length();i++){
        char c =ID.charAt(i);
        int temp=ID.indexOf(c); 
        if(temp<0){
            flag=false;
            break;
            
        }
    }
        if(flag)
        {
            System.out.println("是合法的身份证号码");
        }
  

}
}
